package com.jiyun.racelist.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiyun.model.Race;
import com.jiyun.vo.RaceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RaceMapper extends BaseMapper<Race> {
    Page<RaceVo> findPage(Page<RaceVo> raceVoPage,@Param("ra") RaceVo raceVo);

    @Select("select r.*,r2.startdate startdate,r2.enddate enddate,r2.rank rank1,t.num num,t.state tstate,t.tname tname from race r,race_info r2,team t where r.rid=r2.id and r.tid=t.id and r.id=#{value}")
    List<RaceVo> baoming(Integer id);

    @Select("select r.*,r2.startdate startdate,r2.enddate enddate,r2.rank rank1,t.num num,t.state tstate,t.tname tname from race r,race_info r2,team t where r.rid=r2.id and r.tid=t.id and r.id=#{value}")
    List<RaceVo> BeginJingSai(Integer id);
}
